def Chai(org_num):
    result_array = []
    for n in range(1, 6):
        n1 = 6 - n
        r = (org_num % pow(10, n1) - org_num % pow(10, n1 - 1)) / pow(10, n1 - 1)
        result_array.append(r)
    return result_array

def IsTower(num):
    num_array = Chai(num)
    result = num_array[0] < num_array[1] and num_array[1] < num_array[2] and num_array[3] < num_array[2] and num_array[4] < num_array[3]
    return result

start = int(input("请输入一个起始范围，谢谢。"))
end = int(input("请再输入一个结束范围，谢谢。"))
if start < 10000 or start >= 100000:
    print("亲！起始数要输入5位数呀！")
elif end < 10000 or end >= 100000:
    print("亲！结束数要输入5位数呀！")
else:
    count = 0
    for x in range(start, end):
        result = IsTower(x)
        if result:
            print(x)
            count += 1

    print("哈哈我找到了,在" + str(start) + "和" + str(end) + "范围内我找到了" + str(count) + "个宝塔数。YEAH----")        

